package com.example.demo.utils;

public enum ServerEnum {
	
	consumer("http://spring-cloud-private",1);

	private String url;
	private int index;
	
	
	
	 private ServerEnum(String url, int index) {  
	        this.url = url;  
	        this.index = index;  
	    }  
	    // 普通方法  
	    public static String getName(int index) {  
	        for (ServerEnum c : ServerEnum.values()) {  
	            if (c.getIndex() == index) {  
	                return c.url;  
	            }  
	        }  
	        return null;  
	    }  
	
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public int getIndex() {
		return index;
	}
	public void setIndex(int index) {
		this.index = index;
	}
	
	
}
